<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
    <title>View Package</title>
</h:head>

<h:body onload="#{PackageManaged.searchById()}">
<h:form>
    <p:menubar>  
    <p:menuitem value="Home" url="home.xhtml" /> 
        <p:submenu label="Package Section" >  
            <p:menuitem value="All Packages" url="package.xhtml" />  
        </p:submenu>  
  
        <p:submenu label="Gift List" >  
            <p:menuitem value="My Gift List" url="giftList.xhtml" />    
        </p:submenu>  
  
       <f:facet name="options">   
       		<p:commandButton value="Edit Profile" action="profileEdit.xhtml"/>
            <p:commandButton value="Logout" action="#{LoginManaged.logout()}" icon="ui-icon-close" />
       </f:facet>
    </p:menubar>  
</h:form>
	<h:form>
		<p:panelGrid columns="2">
			<f:facet name="header">Package</f:facet>
			<p:outputLabel value = "Name:"/>
			<h:outputText value="#{PackageManaged.viewedP.name}"/>
			<p:outputLabel value = "Description:"/>
			<h:outputText value="#{PackageManaged.viewedP.description}"/>
			<p:outputLabel value = "Nation:"/>
			<h:outputText value="#{PackageManaged.viewedP.nation}"/>
			<p:outputLabel value = "Price:"/>
			<h:outputText value="#{PackageManaged.viewedP.price}"/>
			<p:outputLabel value = "Hotel:"/>
			<p:commandButton id="hotel" value="Details" onclick="PF('dlgh').show();" />
			<p:outputLabel value = "Going :"/>
			<p:commandButton id="goi" value="Details" onclick="PF('dlgg').show();" />
			<p:outputLabel value = "Return:"/>
			<p:commandButton id="ret" value="Details" onclick="PF('dlgr').show();" />
			<p:outputLabel value = "Excursion:"/>			
			<p:commandButton id="excursion" value="Details" onclick="PF('dlge').show();" />
			<p:panelGrid columns="2">
				<p:outputPanel>Number of People : </p:outputPanel>
    			<p:inputText value="#{PackagePM.bDTO.nOfPeople}"/>
			</p:panelGrid>
		<f:facet name="footer">
			<p:commandButton value="Buy" action="#{PackagePM.buy2(PackageManaged.viewedP,PackageManaged.hDTO,PackageManaged.gDTO,PackageManaged.rDTO,PackageManaged.eDTO)}" ajax="false" />
		</f:facet>
		<p:commandButton value="Customize" action="#{PackageCM.onload(PackageManaged.hDTO.city,PackageManaged.viewedP,PackagePM.bDTO.nOfPeople)}" ajax="false" />
		<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
		</p:panelGrid>


    </h:form>
    
    <p:dialog header="Hotel" widgetVar="dlgh" showEffect="explode" hideEffect="explode">  
    	<p:panelGrid columns="2">
			<p:outputLabel value = "Name:"/>
			<h:outputText value="#{PackageManaged.hDTO.name}"/>
			<p:outputLabel value = "Available Place:"/>
			<h:outputText value="#{PackageManaged.hDTO.availablePlaces}"/>
			<p:outputLabel value = "Description:"/>
			<h:outputText value="#{PackageManaged.hDTO.description}"/>
			<p:outputLabel value = "Website:"/>
			<h:outputText value="#{PackageManaged.hDTO.website}"/>
			<p:outputLabel value = "EMail:"/>
			<h:outputText value="#{PackageManaged.hDTO.email}"/>
			<p:outputLabel value = "City:"/>
			<h:outputText value="#{PackageManaged.hDTO.city}"/>
			<p:outputLabel value = "Stars:"/>
			<h:outputText value="#{PackageManaged.hDTO.stars}"/>
			<p:outputLabel value = "Address:"/>
			<h:outputText value="#{PackageManaged.hDTO.address}"/>
			<p:outputLabel value = "Phone:"/>
			<h:outputText value="#{PackageManaged.hDTO.phone}"/>
			<p:outputLabel value = "Price:"/>
			<h:outputText value="#{PackageManaged.hDTO.price}"/> 
			</p:panelGrid>
	</p:dialog>  
	
	<p:dialog header="Going" widgetVar="dlgg" showEffect="explode" hideEffect="explode">  
    	<p:panelGrid columns="2">
			<h:outputLabel>Name</h:outputLabel>
			<h:outputText value="#{PackageManaged.gDTO.name}" />
			<h:outputLabel>Available Places</h:outputLabel>
			<h:outputText value="#{PackageManaged.gDTO.availablePlaces}" />
			<h:outputLabel>Type</h:outputLabel>
			<h:outputText value="#{PackageManaged.gDTO.type}" />
			<h:outputLabel>Arrival Time</h:outputLabel>
			<h:outputText value="#{PackageManaged.gDTO.arrivalTime}">
    			<f:convertDateTime type="time" timeStyle="short" timeZone="Europe/Paris"/>
    		</h:outputText>
			<h:outputLabel>Departure Time</h:outputLabel>
			<h:outputText value="#{PackageManaged.gDTO.departureTime}">
    			<f:convertDateTime type="time" timeStyle="short" timeZone="Europe/Paris"/>
    		</h:outputText>
			<h:outputLabel>Arrival Date</h:outputLabel>
			<h:outputText value="#{PackageManaged.gDTO.arrivalDate}">
  				<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="Europe/Paris"/>
			</h:outputText>
			<h:outputLabel>Departure Date</h:outputLabel>
			<h:outputText value="#{PackageManaged.gDTO.departureDate}">
  				<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="Europe/Paris"/>
			</h:outputText>
			<h:outputLabel>Arrival Place</h:outputLabel>
			<h:outputText value="#{PackageManaged.gDTO.arrivalPlace}" />
			<h:outputLabel>Departure Place</h:outputLabel>
			<h:outputText value="#{PackageManaged.gDTO.departurePlace}" />
			<h:outputLabel>Company</h:outputLabel>
			<h:outputText value="#{PackageManaged.gDTO.company}" />
			<h:outputLabel>Price</h:outputLabel>
			<h:outputText value="#{PackageManaged.gDTO.price}" />
		</p:panelGrid>
	</p:dialog>  
	
	<p:dialog header="Effects" widgetVar="dlgr" showEffect="explode" hideEffect="explode">  
    	<p:panelGrid columns="2">
			<h:outputLabel>Name</h:outputLabel>
			<h:outputText value="#{PackageManaged.rDTO.name}" />
			<h:outputLabel>Available Places</h:outputLabel>
			<h:outputText value="#{PackageManaged.rDTO.availablePlaces}" />
			<h:outputLabel>Type</h:outputLabel>
			<h:outputText value="#{PackageManaged.rDTO.type}" />
			<h:outputLabel>Arrival Time</h:outputLabel>
			<h:outputText value="#{PackageManaged.rDTO.arrivalTime}">
    			<f:convertDateTime type="time" timeStyle="short" timeZone="Europe/Paris"/>
    		</h:outputText>
			<h:outputLabel>Departure Time</h:outputLabel>
			<h:outputText value="#{PackageManaged.rDTO.departureTime}">
    			<f:convertDateTime type="time" timeStyle="short" timeZone="Europe/Paris"/>
    		</h:outputText>
			<h:outputLabel>Arrival Date</h:outputLabel>
			<h:outputText value="#{PackageManaged.rDTO.arrivalDate}">
  				<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="Europe/Paris"/>
			</h:outputText>
			<h:outputLabel>Departure Date</h:outputLabel>
			<h:outputText value="#{PackageManaged.rDTO.departureDate}">
  				<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="Europe/Paris"/>
			</h:outputText>
			<h:outputLabel>Arrival Place</h:outputLabel>
			<h:outputText value="#{PackageManaged.rDTO.arrivalPlace}" />
			<h:outputLabel>Departure Place</h:outputLabel>
			<h:outputText value="#{PackageManaged.rDTO.departurePlace}" />
			<h:outputLabel>Company</h:outputLabel>
			<h:outputText value="#{PackageManaged.rDTO.company}" />
			<h:outputLabel>Price</h:outputLabel>
			<h:outputText value="#{PackageManaged.rDTO.price}" />
		</p:panelGrid>
	</p:dialog>  
	
	<p:dialog header="Effects" widgetVar="dlge" showEffect="explode" hideEffect="explode">  
    	<p:panelGrid columns="2">
			<p:outputLabel value = "Name:"/>
			<h:outputText value="#{PackageManaged.eDTO.name}"/>
			<p:outputLabel value = "Date:"/>
			<h:outputText value="#{PackageManaged.eDTO.date}">
  				<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="Europe/Paris"/>
			</h:outputText>
			<p:outputLabel value = "Available Place:"/>
			<h:outputText value="#{PackageManaged.eDTO.availablePlaces}"/>
			<p:outputLabel value = "Description:"/>
			<h:outputText value="#{PackageManaged.eDTO.description}"/>
			<p:outputLabel value = "Duration:"/>
			<h:outputText value="#{PackageManaged.eDTO.duration}"/>
			<p:outputLabel value = "Type:"/>
			<h:outputText value="#{PackageManaged.eDTO.type}"/>
			<p:outputLabel value = "City:"/>
			<h:outputText value="#{PackageManaged.eDTO.city}"/>
			<p:outputLabel value = "Price:"/>
			<h:outputText value="#{PackageManaged.eDTO.price}"/>
		</p:panelGrid>
	</p:dialog>  
	<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />	
</h:body>

</html>